//
//  YGPrescriptionBLL.m
//  yuanshangyiliao
//
//  Created by icholab on 2021/4/30.
//

#import "YGPrescriptionBLL.h"
#import "CNHTTPManager.h"
#import "YGPrescriptionModel.h"
@implementation YGPrescriptionBLL

+(void)requestPrescriptionWith:(NSString *)pid
                     priceSord:(NSInteger)priceSord
                       Success:(void (^)(YGPrescriptionModel *model))success
                          fail:(void (^)(NSError *error))fail{
    NSMutableDictionary *dic = [NSMutableDictionary dictionary];
    [dic fa_setObjectSafe:pid forKey:@"selfHelpId"];
    [dic fa_setObjectSafe:@(priceSord) forKey:@"priceSord"];

    [[CNHTTPManager shared]GET:YG_SENDSELFHELP_URL parameters:dic success:^(id responeObj) {
        NSDictionary *data = [responeObj objectForKey:@"data"];
        YGPrescriptionModel *model = [[YGPrescriptionModel alloc] initWithDictionary:data error:nil];
        if (success) {
            success(model);
        }
        } failure:^(NSError *error, NSString *errorDes) {
            if (fail) {
                fail(error);
            }
        }];
}
@end
